 package handling.channel.handler;


import client.MapleCharacter;
import client.MapleClient;
import client.anticheat.CheatingOffense;
import client.inventory.Equip;
import client.inventory.MapleInventoryType;
import client.skills.Skill;
import client.skills.SkillFactory;
import client.skills.SummonSkillEntry;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import constants.SkillConstants;
import handling.opcode.EffectOpcode;
import handling.world.WorldBroadcastService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import server.MapleItemInformationProvider;
import server.MapleStatEffect;
import server.life.MapleMonster;
import server.maps.*;
import server.movement.LifeMovementFragment;
import tools.AttackPair;
import tools.MaplePacketCreator;
import tools.Pair;
import tools.Randomizer;
import tools.data.input.LittleEndianAccessor;
import tools.packet.EffectPacket;
import tools.packet.MobPacket;
import tools.packet.SummonPacket;

import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;






































 public class SummonHandler {
/*  41 */   private static final Logger log = LogManager.getLogger(MovementParse.class.getName());

   public static void MoveDragon(LittleEndianAccessor slea, MapleCharacter chr) {
/*  44 */     int v169 = slea.readInt();
/*  45 */     int tEncodedGatherDuration = slea.readInt();
/*  46 */     Point startPos = slea.readPos();
/*  47 */     Point velPos = slea.readPos();

/*  49 */     List<LifeMovementFragment> res = MovementParse.parseMovement(slea, 5);
/*  50 */     if (chr != null && chr.getDragon() != null && res.size() > 0) {
/*  51 */       startPos = chr.getDragon().getPosition();
/*  52 */       MovementParse.updatePosition(res, (AnimatedMapleMapObject)chr.getDragon(), 0);
/*  53 */       if (!chr.isHidden()) {
/*  54 */         chr.getMap().broadcastMessage(chr, SummonPacket.moveDragon(chr.getDragon(), v169, tEncodedGatherDuration, startPos, velPos, res), chr.getTruePosition());
       }
     }
   }




   public static void DragonFly(LittleEndianAccessor slea, MapleCharacter chr) {
/*  63 */     if (chr == null || chr.getMap() == null || chr.getDragon() == null) {
       return;
     }








/*  74 */     int type = slea.readInt();
/*  75 */     int mountId = (type == 0) ? slea.readInt() : 0;
/*  76 */     chr.getMap().broadcastMessage(chr, MaplePacketCreator.showDragonFly(chr.getId(), type, mountId), chr.getTruePosition());
   }

   public static void MoveSummon(LittleEndianAccessor slea, MapleCharacter chr) {
/*  80 */     if (chr == null || chr.getMap() == null) {
       return;
     }
/*  83 */     int objid = slea.readInt();
/*  84 */     MapleMapObject obj = chr.getMap().getMapObject(objid, MapleMapObjectType.SUMMON);
/*  85 */     if (obj == null) {
       return;
     }
/*  88 */     if (obj instanceof server.maps.MapleDragon) {
/*  89 */       MoveDragon(slea, chr);
       return;
     }
/*  92 */     MapleSummon sum = (MapleSummon)obj;
/*  93 */     if (sum.getOwnerId() != chr.getId() || sum.getSkillLevel() <= 0 || sum.getMovementType() == SummonMovementType.不会移动) {
       return;
     }
/*  96 */     int v169 = slea.readInt();
/*  97 */     int tEncodedGatherDuration = slea.readInt();
/*  98 */     Point startPos = slea.readPos();
/*  99 */     Point velPos = slea.readPos();

/* 101 */     List<LifeMovementFragment> res = MovementParse.parseMovement(slea, 4);

/* 103 */     startPos = sum.getPosition();
/* 104 */     MovementParse.updatePosition(res, (AnimatedMapleMapObject)sum, 0);
/* 105 */     if (res.size() > 0)
     {




/* 111 */       chr.getMap().broadcastMessage(chr, SummonPacket.moveSummon(chr.getId(), sum.getObjectId(), v169, tEncodedGatherDuration, startPos, velPos, res), sum.getTruePosition());
     }
   }


   public static void DamageSummon(LittleEndianAccessor slea, MapleCharacter chr) {
/* 117 */     if (chr == null || !chr.isAlive() || chr.getMap() == null) {
       return;
     }
/* 120 */     int sumoid = slea.readInt();
/* 121 */     MapleSummon summon = chr.getMap().getSummonByOid(sumoid);
/* 122 */     if (summon == null || summon.getOwnerId() != chr.getId()) {
       return;
     }
/* 125 */     int type = slea.readByte();
/* 126 */     int damage = slea.readInt();
/* 127 */     int monsterIdFrom = slea.readInt();
/* 128 */     slea.skip(1);
/* 129 */     int moboid = (slea.available() >= 4L) ? slea.readInt() : 0;
/* 130 */     MapleMonster monster = chr.getMap().getMonsterByOid(moboid);
/* 131 */     if (monster == null) {
       return;
     }
/* 134 */     boolean remove = false;
/* 135 */     if (summon.is替身术() && damage > 0) {
/* 136 */       summon.addSummonHp(-damage);
/* 137 */       if (summon.getSummonHp() <= 0) {
/* 138 */         remove = true;
/* 139 */       } else if (summon.is神箭幻影()) {
/* 140 */         List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
/* 141 */         List<AttackPair> allDamage = new ArrayList<>();
/* 142 */         long theDmg = (long)((SkillFactory.getSkill(summon.getSkillId()).getEffect(summon.getSkillLevel()).getY() * damage) / 100.0D);
/* 143 */         allDamageNumbers.add(new Pair(Long.valueOf(theDmg), Boolean.valueOf(false)));
/* 144 */         allDamage.add(new AttackPair(monster.getObjectId(), allDamageNumbers));
/* 145 */         chr.getMap().broadcastMessage(SummonPacket.summonAttack(summon, (byte)-124, (byte)17, allDamage, chr.getLevel(), true));
/* 146 */         monster.damage(chr, theDmg, true);
/* 147 */         chr.checkMonsterAggro(monster);
/* 148 */         if (!monster.isAlive()) {
/* 149 */           chr.send(MobPacket.killMonster(monster.getObjectId(), 1));
         }
       }
/* 152 */       chr.getMap().broadcastMessage(chr, SummonPacket.damageSummon(chr.getId(), summon.getSkillId(), damage, type, monsterIdFrom), summon.getTruePosition());
     }
/* 154 */     if (remove) {
/* 155 */       chr.dispelSkill(summon.getSkillId());
     }
   }








   public static void SummonAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
/* 167 */     if (chr == null || !chr.isAlive() || chr.getMap() == null) {
       return;
     }
/* 170 */     MapleMap map = chr.getMap();
/* 171 */     int objid = slea.readInt();
/* 172 */     MapleMapObject obj = map.getMapObject(objid, MapleMapObjectType.SUMMON);
/* 173 */     if (obj == null || !(obj instanceof MapleSummon)) {
/* 174 */       chr.dropMessage(5, "召唤兽已经消失。");
       return;
     }
/* 177 */     MapleSummon summon = (MapleSummon)obj;
/* 178 */     if (summon.getOwnerId() != chr.getId() || summon.getSkillLevel() <= 0) {
/* 179 */       chr.dropMessage(5, "出现错误.");
       return;
     }
/* 182 */     int skillid = summon.getSkillId();
/* 183 */     SummonSkillEntry sse = SkillFactory.getSummonData(skillid);
/* 184 */     if (skillid / 1000000 != 35 && skillid != 12120013 && sse == null && skillid != 400041038) {
/* 185 */       chr.dropMessage(5, "召唤兽攻击处理出错。");
       return;
     }
/* 188 */     slea.skip(4);
/* 189 */     int tick = slea.readInt();
/* 190 */     int linkskill = slea.readInt();
/* 191 */     int linkskill2 = slea.readInt();
/* 192 */     boolean uselink = false;
/* 193 */     switch (summon.getSkillId()) {
       case 33001007:
       case 33001008:
       case 33001009:
       case 33001010:
       case 33001011:
       case 33001012:
       case 33001013:
       case 33001014:
       case 33001015:
       case 33111013:
/* 204 */         uselink = true;
         break;
     }
/* 207 */     slea.skip(1);
/* 208 */     byte animation = slea.readByte();
/* 209 */     byte numAttackedAndDamage = slea.readByte();
/* 210 */     byte numAttacked = (byte)(numAttackedAndDamage >>> 4 & 0xF);
/* 211 */     byte numDamage = (byte)(numAttackedAndDamage & 0xF);

/* 213 */     slea.skip(1);
/* 214 */     slea.readInt();
/* 215 */     slea.readInt();
/* 216 */     slea.skip(1);
/* 217 */     slea.readInt();
/* 218 */     slea.readInt();
/* 219 */     slea.readShort();
     int int1;
/* 221 */     if ((int1 = slea.readInt()) > 0);




/* 226 */     List<AttackPair> allDamage = new ArrayList<>();

/* 228 */     for (int i = 0; i < numAttacked; i++) {
/* 229 */       int moboid = slea.readInt();
/* 230 */       slea.readInt();
/* 231 */       byte byte1 = slea.readByte();
/* 232 */       byte byte2 = slea.readByte();
/* 233 */       byte byte3 = slea.readByte();
/* 234 */       slea.readByte();
/* 235 */       slea.readByte();
/* 236 */       slea.readInt();
/* 237 */       slea.skip(1);
/* 238 */       slea.skip(4);
/* 239 */       slea.skip(4);
/* 240 */       slea.skip(4);
/* 241 */       short short1 = slea.readShort();
/* 242 */       slea.skip(4);
/* 243 */       slea.skip(4);
/* 244 */       List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
/* 245 */       for (int j = 0; j < numDamage; j++) {
/* 246 */         long damge = slea.readLong();
/* 247 */         if (chr.isAdmin()) {
/* 248 */           chr.dropMessage(-5, "召唤兽攻击 打怪数量: " + numAttacked + " 打怪次数: " + numDamage + " 打怪伤害: " + damge + " 怪物ID: " + moboid);
         }
/* 250 */         if (damge > chr.getMaxDamageOver(0) && !chr.isGM()) {
/* 251 */           WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + chr.getName() + " ID: " + chr.getId() + " (等级 " + chr.getLevel() + ") 召唤兽攻击伤害异常。打怪伤害: " + damge + " 地图ID: " + chr.getMapId()));
         }
/* 253 */         allDamageNumbers.add(new Pair(Long.valueOf(damge), Boolean.valueOf(false)));
       }
/* 255 */       slea.skip(18);
/* 256 */       slea.skip(1);
/* 257 */       allDamage.add(new AttackPair(moboid, allDamageNumbers));
     }
/* 259 */     Skill summonSkill = SkillFactory.getSkill(skillid);
/* 260 */     MapleStatEffect summonEffect = summonSkill.getEffect(summon.getSkillLevel());
/* 261 */     MapleStatEffect summonAttackEffect = null;
/* 262 */     if (uselink && linkskill2 > 0) {
/* 263 */       summonAttackEffect = SkillFactory.getSkill(linkskill2).getEffect(summon.getSkillLevel());
     }
/* 265 */     if (summonEffect == null) {
/* 266 */       chr.dropDebugMessage(1, "[召唤兽攻击] 召唤兽攻击出现错误 => 攻击效果为空.");

       return;
     }
/* 270 */     if (allDamage.isEmpty()) {
       return;
     }
/* 273 */     map.broadcastMessage(chr, SummonPacket.summonAttack(summon, animation, numAttackedAndDamage, allDamage, chr.getLevel(), false), summon.getTruePosition());
/* 274 */     for (AttackPair attackEntry : allDamage) {
/* 275 */       MapleMonster targetMob = map.getMonsterByOid(attackEntry.objectid);
/* 276 */       if (targetMob == null) {
         continue;
       }
/* 279 */       long totDamageToOneMonster = 0L;
/* 280 */       for (Pair<Long, Boolean> eachde : (Iterable<Pair<Long, Boolean>>)attackEntry.attack) {
/* 281 */         long toDamage = ((Long)eachde.left).longValue();
/* 282 */         if (toDamage < chr.getStat().getCurrentMaxBaseDamage() * 5.0D * (summonEffect.getSelfDestruction() + summonEffect.getDamage() + ((uselink && summonAttackEffect != null) ? summonAttackEffect.getDamage() : 0) + chr.getStat().getDamageIncrease(summonEffect.getSourceid())) / 100.0D) {
/* 283 */           totDamageToOneMonster += toDamage; continue;
         }
/* 285 */         Equip equip = (Equip)chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short)-11);
/* 286 */         if (toDamage > equip.getLimitBreak() + 100000000L) {
/* 287 */           chr.dropDebugMessage(2, "[召唤兽攻击] 召唤兽攻击怪物伤害过高.");
/* 288 */           if (!chr.isGM()) {
/* 289 */             WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + chr.getName() + " ID: " + chr.getId() + " (等级 " + chr.getLevel() + ") 召唤兽攻击伤害异常。打怪伤害: " + toDamage + " 地图ID: " + chr.getMapId()));
             break;
           }
         }
/* 293 */         totDamageToOneMonster += toDamage;
       }

/* 296 */       if (sse != null && sse.delay > 0 && summon.getMovementType() != SummonMovementType.不会移动 && summon.getMovementType() != SummonMovementType.CIRCLE_STATIONARY && summon.getMovementType() != SummonMovementType.自由移动 && chr.getTruePosition().distanceSq(targetMob.getTruePosition()) > 400000.0D && 
/* 297 */         !chr.getMap().isBossMap()) {
/* 298 */         chr.getCheatTracker().registerOffense(CheatingOffense.ATTACK_FARAWAY_MONSTER_SUMMON);
       }

/* 301 */       if (totDamageToOneMonster > 0L) {
/* 302 */         if (chr.isShowPacket()) {
/* 303 */           chr.dropMessage(5, "召唤兽打怪最终伤害 : " + totDamageToOneMonster);
         }
/* 305 */         if (linkskill == 400011104) {
/* 306 */           chr.getSpecialStat().gainXShayatoPoint((allDamage.size() == 1) ? chr.getSkillEffect(400011104).getQ() : chr.getSkillEffect(400011104).getU());
/* 307 */           chr.send(MobPacket.summonUseSkill(targetMob, 400011104, chr));
         }
/* 309 */         targetMob.damage(chr, totDamageToOneMonster, true);
/* 310 */         chr.checkMonsterAggro(targetMob);
/* 311 */         if (!targetMob.isAlive()) {
/* 312 */           chr.send(MobPacket.killMonster(targetMob.getObjectId(), 1)); continue;
         }
/* 314 */         if (summonEffect.getMonsterStati().size() > 0 && 
/* 315 */           summonEffect.makeChanceResult()) {
/* 316 */           for (Map.Entry<MonsterStatus, Integer> z : (Iterable<Map.Entry<MonsterStatus, Integer>>)summonEffect.getMonsterStati().entrySet()) {
/* 317 */             targetMob.applyStatus(chr, new MonsterStatusEffect(z.getKey(), z.getValue(), summonSkill.getId(), null, false, 0), summonEffect.isPoison(), 4000L, true, summonEffect);
           }
         }
       }
     }



/* 325 */     switch (linkskill) {
       case 400011104:
/* 327 */         if (animation != -103) {
/* 328 */           chr.getMap().broadcastMessage(chr, SummonPacket.SummonedDrawEffect(summon, 3), true);
         }
         break;
     }

/* 333 */     if ((summonEffect.getSkill().isNonExpireSummon() && System.currentTimeMillis() > summon.getCreateTime() + summonEffect.getDuration()) || (skillid == 400011104 && animation == -103)) {
/* 334 */       chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
/* 335 */       chr.getMap().removeMapObject((MapleMapObject)summon);
/* 336 */       chr.removeVisibleMapObject((MapleMapObject)summon);
/* 337 */       chr.removeSummon(summon);
/* 338 */       if (skillid == 400011104) {
/* 339 */         chr.gainHayatoPoint(chr.getSpecialStat().getXShayatoPoint());
/* 340 */         chr.getSpecialStat().setXShayatoPoint(0);
       }
     }
   }

   public static void RemoveSummon(LittleEndianAccessor slea, MapleClient c) {
/* 346 */     int objid = slea.readInt();
/* 347 */     MapleMapObject obj = c.getPlayer().getMap().getMapObject(objid, MapleMapObjectType.SUMMON);
/* 348 */     if (obj == null || !(obj instanceof MapleSummon)) {
       return;
     }
/* 351 */     MapleSummon summon = (MapleSummon)obj;
/* 352 */     if (summon.getOwnerId() != c.getPlayer().getId() || summon.getSkillLevel() <= 0) {
/* 353 */       c.getPlayer().dropMessage(5, "移除召唤兽出现错误.");
       return;
     }
/* 356 */     if (c.getPlayer().isShowPacket()) {
/* 357 */       c.getPlayer().dropSpouseMessage(10, "收到移除召唤兽信息 - 召唤兽技能ID: " + summon.getSkillId() + " 技能名字 " + SkillFactory.getSkillName(summon.getSkillId()));
     }
/* 359 */     if (summon.getSkillId() == 35111002) {
       return;
     }
/* 362 */     c.getPlayer().getMap().broadcastMessage(SummonPacket.removeSummon(summon, false));
/* 363 */     c.getPlayer().getMap().removeMapObject((MapleMapObject)summon);
/* 364 */     c.getPlayer().removeVisibleMapObject((MapleMapObject)summon);
/* 365 */     c.getPlayer().removeSummon(summon);
/* 366 */     c.getPlayer().dispelSkill(summon.getSkillId());
/* 367 */     if (summon.is天使召唤兽()) {
/* 368 */       int buffId = (summon.getSkillId() % 10000 == 1087) ? 2022747 : ((summon.getSkillId() % 10000 == 1179) ? 2022823 : 2022746);
/* 369 */       c.getPlayer().dispelBuff(buffId);
     }
/* 371 */     if (summon.getSkillId() == 400051011)
/* 372 */       c.getPlayer().send(MaplePacketCreator.userBonusAttackRequest(400051011, 0, Collections.emptyList()));  } public static void SubSummon(LittleEndianAccessor slea, MapleCharacter chr) {
     int i;
     Skill bHealing;
     int j, bHealingLvl;
     MapleStatEffect healEffect;
/* 377 */     MapleMapObject obj = chr.getMap().getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
/* 378 */     if (obj == null || !(obj instanceof MapleSummon)) {
       return;
     }
/* 381 */     MapleSummon sum = (MapleSummon)obj;
/* 382 */     if (sum.getOwnerId() != chr.getId() || sum.getSkillLevel() <= 0 || !chr.isAlive()) {
       return;
     }
/* 385 */     switch (sum.getSkillId()) {
       case 35121009:
/* 387 */         if (!chr.canSummon(2000)) {
           return;
         }
/* 390 */         for (i = 0; i < 3; i++) {
/* 391 */           MapleStatEffect effect = SkillFactory.getSkill(35121011).getEffect(sum.getSkillLevel());
/* 392 */           MapleSummon tosummon = new MapleSummon(chr, effect, new Point((sum.getTruePosition()).x, (sum.getTruePosition()).y - 5), SummonMovementType.自由移动, effect.getDuration(), 0);
/* 393 */           chr.getMap().spawnSummon(tosummon);
/* 394 */           chr.addSummon(tosummon);
         }
         break;
       case 35111008:
       case 35120002:
/* 399 */         if (!chr.canSummon(1000)) {
           return;
         }
/* 402 */         chr.addHP((int)((chr.getStat().getCurrentMaxHp() * SkillFactory.getSkill(sum.getSkillId()).getEffect(sum.getSkillLevel()).getHp()) / 100.0D));
/* 403 */         chr.send(EffectPacket.showOwnBuffEffect(sum.getSkillId(), EffectOpcode.UserEffect_SkillAffected.getValue(), chr.getLevel(), sum.getSkillLevel()));
/* 404 */         chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, sum.getSkillId(), EffectOpcode.UserEffect_SkillAffected.getValue(), chr.getLevel(), sum.getSkillLevel()), false);
         break;
       case 1301013:
/* 407 */         bHealing = SkillFactory.getSkill(slea.readInt());
/* 408 */         bHealingLvl = chr.getTotalSkillLevel(bHealing);
/* 409 */         if (bHealingLvl <= 0 || bHealing == null) {
           return;
         }
/* 412 */         healEffect = bHealing.getEffect(bHealingLvl);
/* 413 */         if (bHealing.getId() == 1310016) {
/* 414 */           healEffect.applyTo(chr);
/* 415 */         } else if (bHealing.getId() == 1301013) {
/* 416 */           if (!chr.canSummon(healEffect.getX() * 1000)) {
             return;
           }
/* 419 */           int healHp = Math.min(1000, healEffect.getHp() * chr.getLevel());
/* 420 */           chr.addHP(healHp);
         }
/* 422 */         chr.send(EffectPacket.showOwnBuffEffect(sum.getSkillId(), EffectOpcode.UserEffect_SkillAffected.getValue(), chr.getLevel(), bHealingLvl));
/* 423 */         chr.getMap().broadcastMessage(SummonPacket.summonSkill(chr.getId(), sum.getSkillId(), (bHealing.getId() == 1301013) ? 5 : (Randomizer.nextInt(3) + 6)));
/* 424 */         chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, sum.getSkillId(), EffectOpcode.UserEffect_SkillAffected.getValue(), chr.getLevel(), bHealingLvl), false);
         break;







       case 36121014:
/* 434 */         SkillFactory.getSkill(sum.getSkillId()).getEffect(sum.getSkillLevel()).applyTo(chr);
         break;
       case 400051022:
/* 437 */         for (j = 0; j < 2; j++) {
/* 438 */           chr.getSkillEffect(400051023).applyTo(chr, sum.getPosition(), true);
         }
         break;


       case 400041038:
/* 444 */         chr.handle达克鲁秘卷();

/* 446 */         chr.send(EffectPacket.showSkillEffect(sum.getSkillId(), sum.getSkillLevel()));

/* 448 */         chr.getMap().broadcastMessage(chr, EffectPacket.showSkillEffect(chr, sum.getSkillId(), sum.getSkillLevel()), false);
         break;
     }

/* 452 */     if (SkillConstants.is天使祝福戒指(sum.getSkillId())) {
/* 453 */       if (sum.getSkillId() % 10000 == 1087) {
/* 454 */         MapleItemInformationProvider.getInstance().getItemEffect(2022747).applyTo(chr);
/* 455 */       } else if (sum.getSkillId() % 10000 == 1179) {
/* 456 */         MapleItemInformationProvider.getInstance().getItemEffect(2022823).applyTo(chr);
       } else {
/* 458 */         MapleItemInformationProvider.getInstance().getItemEffect(2022746).applyTo(chr);
       }
/* 460 */       chr.send(EffectPacket.showOwnBuffEffect(sum.getSkillId(), EffectOpcode.UserEffect_SkillAffected.getValue(), 2, 1));
/* 461 */       chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, sum.getSkillId(), EffectOpcode.UserEffect_SkillAffected.getValue(), 2, 1), false);
     }
   }

   public static void MoveLittleWhite(LittleEndianAccessor slea, MapleCharacter chr) {
/* 466 */     slea.skip(17);
/* 467 */     List<LifeMovementFragment> res = MovementParse.parseMovement(slea, 7);

/* 469 */     if (res != null && chr != null && chr.getMap() != null && chr.getLittleWhite() != null && res.size() > 0) {
/* 470 */       if (slea.available() != 0L) {


/* 473 */         log.error("slea.available() != 1 (小白移动错误) 封包: " + slea.toString(true));
         return;
       }
/* 476 */       Point pos = new Point(chr.getLittleWhite().getPosition());
/* 477 */       chr.getLittleWhite().updatePosition(res);
/* 478 */       if (!chr.isHidden()) {
/* 479 */         chr.getMap().broadcastMessage(chr, SummonPacket.moveLittleWhite(chr.getId(), chr.getLittleWhite().getObjectId(), pos, chr.getLittleWhite().getStance(), res), false);
       }
     }
   }

   public static void SubLittleWhite(LittleEndianAccessor slea, MapleCharacter chr) {
/* 485 */     slea.skip(4);
/* 486 */     int skillType = slea.readInt();
/* 487 */     Skill bHealing = SkillFactory.getSkill(42120011);
/* 488 */     int bHealingLvl = chr.getTotalSkillLevel(bHealing);
/* 489 */     boolean forth = true;
/* 490 */     if (bHealingLvl <= 0 || bHealing == null) {
/* 491 */       bHealing = SkillFactory.getSkill(42101002);
/* 492 */       bHealingLvl = chr.getTotalSkillLevel(bHealing);
/* 493 */       forth = false;
     }
/* 495 */     if (bHealingLvl <= 0 || bHealing == null) {
       return;
     }
/* 498 */     int effectid = 0;
/* 499 */     switch (skillType) {
       case 3:
/* 501 */         effectid = 42101021;
         break;
       case 5:
/* 504 */         effectid = 42101023;
         break;
     }
/* 507 */     effectid += forth ? 20000 : 0;
/* 508 */     bHealing = SkillFactory.getSkill(effectid);
/* 509 */     bHealingLvl = chr.getTotalSkillLevel(bHealing);
/* 510 */     MapleStatEffect healEffect = bHealing.getEffect(bHealingLvl);
/* 511 */     if (healEffect != null) {
/* 512 */       healEffect.applyTo(chr);
     }

/* 515 */     chr.getMap().broadcastMessage(EffectPacket.show影朋小白效果(skillType));
/* 516 */     chr.getMap().broadcastMessage(chr, EffectPacket.show影朋小白效果(skillType), false);
   }
 }


/* Location:              C:\PGX\Server.jar!\handling\channel\handler\SummonHandler.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */